home *** CD-ROM | disk | FTP | other *** search
- File Point Mod
- Ice Man #1 @8406
- Saturday, December 14, 1991 6:07 pm
-
- File Point Mod
- By Ice Man #1 @8406
-
- Description: Allows sysops to use a file point system instead of the normal
- ratio system. For every file point a user has, they can
- download 1 K. When a user sends in money, add the appropriate
- number of file points to his/her account. This mod also keeps
- track of how much a user has contributed, although its not
- related to how many file points they have.
- WWIV version: 4.11, but could be easily adapted to 4.12 or 4.20 as far as I
- can tell.
- Files affected: XFER.C, VARDEC.H, SYSOPF.C
-
- Step 1. First off, since this mod changes your user structure, you'll have to
- do one of two things: a) trash your user list, or b) get a CONVERT.C
- for WWIV 4.11, and modify it do it'll convert your old user list into
- a new one with this mod in. If you know C pretty good, try B. If you
- don't, either try A or don't put this mod in.
-
- Step 2. BACKUP YOUR SOURCE CODE!!!
-
- Step 3. Load up VARDEC.H and make the following changes:
-
- /*==*/ ontoday; /* num times on today */
- /*==*/ unsigned short homeuser,homesys, /* where user can be found */
- /*++*/ contrib, /* $ contributed by user */
- /*==*/ forwardusr,forwardsys, /* where to forward mail */
- /*==*/ msgpost, /* number messages posted */
- /*==*/ unsigned long msgread, /* total num msgs read */
- /*++*/ dlpoints, /* user's DL points */
- /*==*/ uk, /* number of k uploaded */
- /*==*/ dk, /* number of k downloaded */
-
- Step 4. Load up SYSOPF.C and seach(^Q,F) down for void uedit(blahblah). Make
- the following changes:
-
- /*==*/prt(2,"Uedit : ");
- /*==*/if ((realsl==255) || (wfc))
- /*+-*/ ch=onek("#$Q[]{}/,.?UDRNLCPOGMSTEYZAI~:"); /* # and $ added */
- /*==*/else /* # for file points */
- /*+-*/ ch=onek("#$Q[]{}/,.?UDRNLCPOGMSTEYZAI"); /* $ for contributed */
- /*==*/switch(ch) {
- /*add*/ case '#':
- /*from*/ prt(2,"New file points? ");
- /*here*/ input(s2,5);
- if (s2[0])
- i=atoi(s2);
- u.dlpoints=i;
- ite_user(un,&u);
- }
- break;
- case '$':
- prt(2,"New money contributed? (without dollar sign) ");
- input(s2,5);
- if (s2[0]) {
- i=atoi(s2);
- u.contrib=i;
- write_user(un,&u);
- }
- /* here */break;
- /*==*/ case 'Q':
- /*==*/ done=1;
-
- Step 5. Load up XFER.C and search down for void download_temp_arc(). Search
- down and make the following changes:
-
- /*==*/ numbytes=filelength(f);
- /*==*/ close(f);
- /*++*/ if ((numbytes+1023)/1024>thisuser.dlpoints) {
- /*++*/ nl();
- /*++*/ prt(5,"I'm sorry, you don't have enough file points to DL that file.");
- /*++*/ nl();
- /*++*/ return;
- /*++*/ }
- /*==*/ if (numbytes==0L) {
- /*==*/ nl();
-
- Step 6. Still in void download_temp_arc(), search down a little further and
- make the following changes:
-
- /*==*/ sprintf(s1,"%-6.3f",ratio());
- /*==*/ print("Your ratio is now: ",s1,"");
- /*++*/ thisuser.dlpoints=thisuser.dlpoints-(((numbytes)+1023)/1024);
- /*++*/ ltoa(thisuser.dlpoints,s,10);
- /*++*/ prt(0,"You now have ");
- /*++*/ prt(0,s);
- /*++*/ pl(" file points left.");
- /*==*/
- /*==*/ if (useron)
- /*==*/ topscreen();
-
- Step 7. Still in XFER.C, search down (^Q,F) for int try_to_download() and make
- the following changes:
-
- /*==*/ SETREC(i);
- /*==*/ read(dlf,(void *)&u,sizeof(uploadsrec));
- /*++*/ if ((u.numbytes+1023)/1024>thisuser.dlpoints) {
- /*++*/ nl();
- /*++*/ prt(5,"I'm sorry, you don't have enough file points to DL that file.");
- /*++*/ nl();
- /*++*/ closedl();
- /*++*/ return(-1);
- /*++*/ }
- /*==*/ nl();
- /*==*/ if (title)
- /*==*/ print("Directory : ",directories[dn].name,"");
-
- Step 8. A little bit further down, make the following changes:
-
- /*==*/ sprintf(s1,"%-6.3f",ratio());
- /*==*/ print("Your ratio is now: ",s1,"");
- /*++*/ thisuser.dlpoints=thisuser.dlpoints-(((u.numbytes)+1023)/1024);
- /*++*/ ltoa(thisuser.dlpoints,s,10);
- /*++*/ prt(0,"You now have ");
- /*++*/ prt(0,s);
- /*++*/ pl(" file points left.");
- /*==*/
- /*==*/ if (useron)
- /*==*/ topscreen();
-
- Step 9. Still in XFER.C, search down for void yourinfodl() and replace the
- entire function with this one.
-
- void yourinfodl()
- {
- char s[81],s1[81],s2[81],s3[81],s4[81];
-
- itoa(thisuser.uploaded,s,10);
- itoa(thisuser.downloaded,s1,10);
- ltoa(thisuser.uk,s2,10);
- ltoa(thisuser.dk,s3,10);
- ltoa(thisuser.dlpoints,s4,10);
- nl();
- nl();
- print("Uploads : ",s2,"k in ",s," files","");
- print("Downloads: ",s3,"k in ",s1," files","");
- print("File Points (K you can DL): ",s4,""); /* add */
- sprintf(s,"%-6.3f",ratio());
- print("Ratio : ",s,"");
- itoa(thisuser.dsl,s,10);
- print("Your DSL : ",s,"");
- nl();
- }
-
- Step 10. Recompile it!
-
- If you have any questions, complaints, comments, etc., sent them to #1
- @8406(WWIVnet). If you use this mod, please leave me some mail telling me you
- are. If you're using 4.20, but would really like to use this mod, e-mail me
- and I'll try and write one for it.